<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Title')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-title" data-rule="required" class="form-control" name="row[title]" type="text">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Title2')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-title2" class="form-control" name="row[title2]" type="text">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Category_id')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-category_id" data-rule="required" data-source="category/selectpage" data-order-by="weigh" data-params='{"custom[pid]":"45","custom[status]":"normal"}' class="form-control selectpage" name="row[category_id]" type="text" placeholder="请选择">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Tag_ids')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-tag_ins" data-rule="required" data-source="news/news_tag/selectpage" data-multiple="true" class="form-control selectpage" name="row[tag_ids]" type="text" placeholder="请选择（支持多选）" >
        </div>
    </div>
    <!-- 旧版分类 -->
    <!-- <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Lx')}:</label>
        <div class="col-xs-12 col-sm-8">

            <select  id="c-lx" data-rule="required" class="form-control selectpicker" name="row[lx]">
                {foreach name="lxList" item="vo"}
                    <option value="{$key}" {in name="key" value=""}selected{/in}>{$vo}</option>
                {/foreach}
            </select>

        </div>
    </div> -->
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Indexs')}:</label>
        <div class="col-xs-12 col-sm-8">
            <!-- <input id="c-indexs" data-rule="required;length(100~)" class="form-control" name="row[indexs]" type="text"> -->
            <textarea id="c-indexs" data-rule="required;length(100~)" class="form-control" rows="3" name="row[indexs]" cols="50"></textarea>
        </div>
    </div>
    <!-- 新闻类型 -->
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('type')}:</label>
        <div class="col-xs-12 col-sm-8">
            <select  id="c-type" data-rule="required" class="form-control selectpicker" name="row[type]">
                {foreach name="typeList" item="vo"}
                    <option class="news_type" value="{$key}" {in name="key" value="0"}selected{/in}>{$vo}</option>
                {/foreach}
            </select>
        </div>
    </div>
    <!-- 封面上传组件 -->
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Image')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="input-group" style="display: flex;">
                <input id="c-image" class="form-control" size="50" name="row[image]" data-rule="required" type="hidden">
                <div class="input-group no-border no-padding">
                    <span><button type="button" id="plupload-image" class="btn btn-danger plupload" data-multipart={"module":"h/newspic"} data-maxcount="3" data-maxsize="500k" data-input-id="c-image" data-mimetype="image/jpeg,image/png,image/jpg" data-multiple="true" data-preview-id="p-image"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                </div>
                <span class="msg-box n-right" for="c-image"></span>
                <span style="margin: 7px 10px;display: block;">支持1-3张图，图片1024*1024，1:1格式，小于500kb</span>
            </div>
            <ul class="row list-inline plupload-preview" id="p-image"></ul>
        </div>
    </div>
    <!-- 图片新闻模式 - 图片上传 -->
    <div class="form-group picture-upload" style="display:none">
        <label class="control-label col-xs-12 col-sm-2">{:__('Picture')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="input-group" style="display: flex;">
                <input id="c-picture" class="form-control" size="50" name="row[picture]" data-rule="" type="hidden">
                <div class="input-group no-border no-padding">
                    <span><button type="button" id="plupload-picture" class="btn btn-danger plupload" data-multipart={"module":"h/newspic"} data-maxsize="800k" data-input-id="c-picture" data-mimetype="image/jpeg,image/png,image/jpg" data-multiple="true" data-preview-id="p-picture"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                </div>
                <span style="margin: 7px 20px;display: block;">建议图片1280*1280，1:1格式，小于800kb</span>
                <span class="msg-box n-right" for="c-picture"></span>
            </div>
            <ul class="row list-inline plupload-preview" id="p-picture" data-template="picturetpl" data-name="row[picture_intro]"></ul>
            <textarea name="row[picture_intro]" class="form-control" style="margin-top:5px;display:none;"></textarea>
        </div>
    </div>
    <script type="text/html" id="picturetpl">
        <li class="col-xs-12" style="display: flex;">
            <div style="width:100px;height:110px;">
                <a style="padding:5px;;width:100px;height:90px;margin-bottom:0;border-radius: 0;" href="<%=fullurl%>" data-url="<%=url%>" target="_blank" class="thumbnail">
                    <img style="width:100%;height:100%;" src="<%=fullurl%>" class="img-responsive">
                </a>
                <a style="width:100px;height:20px;border-radius: 0" href="javascript:;" class="btn btn-danger btn-xs btn-trash"><i class="fa fa-trash"></i></a>
            </div>
            <textarea style="width:100%;height:110px;margin-left:10px;resize:none;" name="row[picture_intro][<%=index%>]" maxlength="100" class="form-control" placeholder="文字简介，小于100字"><%=value?value:''%></textarea>
        </li>
    </script>
    <!-- 视频上传组件 -->
    <div class="form-group video-upload" style="display:none;">
        <label class="control-label col-xs-12 col-sm-2">{:__('Video')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="input-group">
                <div style="margin-right:10px;" class="input-group-addon no-border no-padding">
                    <span><button style="border-radius: 5px 0 0 5px;" type="button" id="plupload-video" class="btn btn-danger plupload" data-multipart={"module":"h/newspic"} data-maxsize="200m" data-input-id="c-video" data-mimetype="video/*" data-multiple="false""><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                </div>
                <input style="border-radius: 0 5px 5px 0;" id="c-video" data-rule="" class="form-control" size="50" name="row[video]" type="text">
                <span class="msg-box n-right" for="c-video"></span>
            </div>
            <span style="margin: 7px 3px;display: block;">小于200mb</span>
        </div>
    </div>
    <!-- 外链地址 -->
    <div class="form-group outlink-newstype" style="display:none;">
        <label class="control-label col-xs-12 col-sm-2">{:__('Outlink')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-outlink" data-rule="" class="form-control" name="row[outlink]" type="text" placeholder="http://">
        </div>
    </div>

    <!-- 显示模式 -->
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('display_mode')}:</label>
        <div class="col-xs-12 col-sm-8">
            <select  id="c-display_mode" data-rule="required" class="form-control selectpicker" name="row[display_mode]">
                {foreach name="displayModeList" item="vo"}
                    <option value="{$key}" {in name="key" value="0"}selected{/in}>{$vo}</option>
                {/foreach}
            </select>
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Content')}:</label>
        <div class="col-xs-12 col-sm-8">
            <textarea id="c-content" data-rule="required" class="form-control editor" rows="10" name="row[content]" cols="100"></textarea>
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Newhouse_ids')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-newhouse_ids" data-source="newhouse/newhouse/index" data-field="title" data-multiple="true" class="form-control selectpage" name="row[newhouse_ids]" type="text" value="">
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('weigh')}:</label>
        <div class="col-xs-12 col-sm-8">
            <!-- <input id="c-weigh" data-rule="" class="form-control" value="0" name="row[weigh]" type="text"> -->
            <select  id="c-weigh" data-rule="required" class="form-control selectpicker" name="row[weigh]">
                {foreach name="weighList" item="vo"}
                    <option value="{$key}" {in name="key" value="0"}selected{/in}>{$vo}</option>
                {/foreach}
            </select>
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Nfrom')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-nfrom" data-rule="required" class="form-control" value="湛江购房网" name="row[nfrom]" type="text">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Skey')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-skey" data-rule="required" class="form-control" name="row[skey]" type="text" placeholder="多关键字请用 “,” 号隔开">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('commentswitch')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-commentswitch" name="row[commentswitch]" type="hidden" value="1">
            <a href="javascript:;" data-toggle="switcher" class="btn-switcher" data-input-id="c-commentswitch" data-yes="1" data-no="0" >
            <i class="fa fa-toggle-on text-success fa-2x"></i>
            </a>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Titlecolor')}:</label>
        <div class="col-xs-12 col-sm-8">

            <select  id="c-titlecolor" class="form-control selectpicker" name="row[titlecolor]">
                {foreach name="titlecolorList" item="vo"}
                <option value="{$key}" {in name="key" value=""}selected{/in}>{$vo}</option>
                {/foreach}
            </select>

        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Titlebold')}:</label>
        <div class="col-xs-12 col-sm-8">

            <div class="radio">
            {foreach name="titleboldList" item="vo"}
            <label for="row[titlebold]-{$key}"><input id="row[titlebold]-{$key}" name="row[titlebold]" type="radio" value="{$key}" {in name="key" value="0"}checked{/in} /> {$vo}</label>
            {/foreach}
            </div>

        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Hits')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-hits" data-rule="required" class="form-control" value="0" name="row[hits]" type="text" disabled="disabled">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Addhits')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-addhits" data-rule="required" class="form-control" value="0" name="row[addhits]" type="text">
        </div>
    </div>
    <!-- 属性 -->
    <!-- <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Attribute')}:</label>
        <div class="col-xs-12 col-sm-8">

            <select  id="c-attribute" data-rule="required" class="form-control selectpicker" name="row[attribute]">
                {foreach name="attributeList" item="vo"}
                <option value="{$key}" {in name="key" value="0"}selected{/in}>{$vo}</option>
                {/foreach}
            </select>

        </div>
    </div> -->
    <!-- 站点 -->
    <!-- <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Qy')}:</label>
        <div class="col-xs-12 col-sm-8">

            <select  id="c-qy" data-rule="required" class="form-control selectpicker" name="row[qy]">
                {foreach name="qyList" item="vo"}
                    <option value="{$key}" {in name="key" value="0"}selected{/in}>{$vo}</option>
                {/foreach}
            </select>

        </div>
    </div> -->
    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-admin_id" class="form-control" name="row[admin_id]" type="hidden" value="{:$auth->id}">
            <button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
</form>
